import java.util.Scanner;

public class test1 {
    //递归求n的阶乘
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入n:");
        int n = sc.nextInt();
        int result = getResult(n);
        System.out.println("阶乘结果为:"+result);
    }
    public static int getResult(int n){
        if(n==1){
            return 1;
        }else {
         return n*getResult(n-1);
        }
    }
}
